<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>EventConfig 类</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="eventbufferevent.about.callbacks.html">« About buffer event callbacks</a></li>
      <li style="float: right;"><a href="eventconfig.avoidmethod.html">EventConfig::avoidMethod »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.event.html">Event</a></li>
    <li>EventConfig 类</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.eventconfig" class="reference">
 <h1 class="title">EventConfig 类</h1>
 
 <div class="partintro"><p class="verinfo">(PECL event &gt;= 1.2.6-beta)</p>

  <div class="section" id="eventconfig.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    表示可以实例化 <span class="classname"><a href="class.eventbase.html" class="classname">EventBase</a></span> 的配置结构。
   </p>
  </div>

  <div class="section" id="eventconfig.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">final</span>
      <span class="modifier">class</span> <strong class="classname">EventConfig</strong>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.eventconfig.html#eventconfig.constants.feature-et"><var class="varname">FEATURE_ET</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.eventconfig.html#eventconfig.constants.feature-o1"><var class="varname">FEATURE_O1</var></a></var><span class="initializer"> = 2</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.eventconfig.html#eventconfig.constants.feature-fds"><var class="varname">FEATURE_FDS</var></a></var><span class="initializer"> = 4</span>;</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><a href="eventconfig.avoidmethod.html" class="methodname">avoidMethod</a></span>(<span class="methodparam">
    <span class="type">string</span>
     <code class="parameter">$method</code>
   </span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventconfig.construct.html" class="methodname">__construct</a></span>()</div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventconfig.requirefeatures.html" class="methodname">requireFeatures</a></span>(<span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$feature</code>
   </span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventconfig.setflags.html" class="methodname">setFlags</a></span>(<span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$flags</code>
   </span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventconfig.setmaxdispatchinterval.html" class="methodname">setMaxDispatchInterval</a></span>(<span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$max_interval</code>
   </span>, <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$max_callbacks</code>
   </span>, <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$min_priority</code>
   </span>): <span class="type"><span class="type void">void</span></span></div>

   }</div>

  </div>

  <div class="section" id="eventconfig.constants">
   <h2 class="title">预定义常量</h2>
   <dl>
    
     <dt id="eventconfig.constants.feature-et">
      <strong><code>EventConfig::FEATURE_ET</code></strong>
     </dt>

     <dd>

      <p class="para">
       需要支持边缘触发 I/O 的后端方法。
      </p>
     </dd>

    
    
     <dt id="eventconfig.constants.feature-o1">
      <strong><code>EventConfig::FEATURE_O1</code></strong>
     </dt>

     <dd>

      <p class="para">
       要求添加/删除 event 或者使 event 成为活跃的后端方法是O(1)操作。
      </p>
     </dd>

    
    
     <dt id="eventconfig.constants.feature-fds">
      <strong><code>EventConfig::FEATURE_FDS</code></strong>
     </dt>

     <dd>

      <p class="para">
       需要一个可以支持任何文件描述符类型的后端方法，而不仅仅是 socket 。
      </p>
     </dd>

    
   </dl>

  </div>

 </div>

 



































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="eventconfig.avoidmethod.html">EventConfig::avoidMethod</a> — 告诉 libevent 避免使用指定 event 方法</li><li><a href="eventconfig.construct.html">EventConfig::__construct</a> — EventConfig 构造函数</li><li><a href="eventconfig.requirefeatures.html">EventConfig::requireFeatures</a> — 输入应用程序要求的必需 event 方法功能</li><li><a href="eventconfig.setflags.html">EventConfig::setFlags</a> — EventBase 初始化需设置的一个或者多个 flag</li><li><a href="eventconfig.setmaxdispatchinterval.html">EventConfig::setMaxDispatchInterval</a> — 防止优先级反转</li></ul>
</div>
</div></div></body></html>